var xmlhttp;
var servidor="Ajax/conexion.php";

function getVote(entero)
{
    xmlhttp=GetXmlHttpObject();
    if (xmlhttp==null)
    {
        alert ("Tu navegador no soporta HTTP");
        return;
    }
    var url="poll_vote.php";
    url=url+"?vote="+entero;
    url=url+"&sid="+Math.random();
    xmlhttp.onreadystatechange=stateChanged;
    xmlhttp.open("GET",url,true);
    xmlhttp.send(null);
}

function stateChanged()
{
    if (xmlhttp.readyState==4)
    {
        document.getElementById("poll").innerHTML=xmlhttp.responseText;
    }
}

function GetXmlHttpObject()
{
    var objXMLHttp=null;
    if (window.XMLHttpRequest)
    {
        objXMLHttp=new XMLHttpRequest();
    }
    else if (window.ActiveXObject)
    {
        objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
    return objXMLHttp;
}